﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using RaisingStudio.Data;
using RaisingStudio.Data.Entities;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            RaisingStudio.Data.DataContext dc = new DataContext("WpfApplication1.Properties.Settings.MySqlConnectionString");
            dc.Log = Console.Out;
            var q = dc.Query<Product>();
            Console.WriteLine(q.Count());

            //System.Data.SQLite.SQLiteConnection connection = new System.Data.SQLite.SQLiteConnection("Data Source=test.db");
            //connection.Open();

            RaisingStudio.Data.DataContext sqliteDc = new DataContext("WpfApplication1.Properties.Settings.SqliteConnectionString");
            sqliteDc.Log = Console.Out;
            var q2 = sqliteDc.Query<Product>();
            Console.WriteLine(q2.Count());
        }
    }
}
